package com.econ.powercloud.ems.controller.highpressure;

import com.econ.powercloud.common.base.facade.pojo.MsgResult;
import com.econ.powercloud.ems.controller.ApiBaseController;
import com.econ.powercloud.ems.pojo.EmsDeviceVO;
import com.econ.powercloud.ems.service.biz.DeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author : wan
 * @Description :
 * @Date : 2020/11/25 15:02
 * @Modified by : wan
 */
@Api(tags = "高压设备管理")
@RestController
@RequestMapping(value = "/api/v2/high/device")
public class HighDeviceController extends ApiBaseController {

    @Autowired
    private DeviceService deviceService;

    @ApiOperation(value = "获取高压储能站的电池簇列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "stationId", value = "储能站id", dataType = "String")
    })
    @GetMapping("queryClusterTree")
    public MsgResult<List<EmsDeviceVO>> queryClusterTree(@RequestParam(value = "stationId") String stationId){
        return successHandler(deviceService.queryHighClusterTree(stationId));
    }
}
